﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web2.xhz
{
    public partial class EssaysAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //插入数据库
            Maticsoft.BLL.Essays bll = new Maticsoft.BLL.Essays();
            Maticsoft.Model.Essays model = new Maticsoft.Model.Essays();
            model.Title = TitleText.Text;
            model.Content = elm1.InnerText;
            if (bll.Add(model)<1)
            {
                Response.Write("<script>alert('添加失败！'); </script>");
            }
            else
            {
                Response.Write("<script>alert('添加成功！'); </script>");
            }
            
        }
    }
}